#include <string>
#include <unordered_map>
using namespace std;
class Solution {
public:
  string getHint(string secret, string guess) {
    string ans = "";
    unordered_map<char, int> h;
    int Ccount = 0, Bcount = 0;
    for (int i = 0; i < secret.length(); i++) {
      if (secret[i] == guess[i]) {
        Bcount++;
        guess[i] = ' ';
      } else {
        h[secret[i]]++;
      }
    }

    for (int i = 0; i < guess.size(); ++i) {
      if (h[guess[i]] > 0) {
        Ccount++;
        h[guess[i]]--;
      }
    }
    ans = to_string(Bcount) + "A" + to_string(Ccount) + "B";
    return ans;
  }
};